package com.jetsum.micro.controller;

import com.jetsum.api.service.HelloService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Reference(loadbalance = "roundrobin")
    private HelloService helloService;

    @GetMapping("/welcome")
    public String welcome() {
        return "welcome";
    }

    @GetMapping("/hello")
    public String hello(String name) {
        return helloService.sayHello(name);
    }
}
